package com.springmvchomework.service;

import com.springmvchomework.dao.StudentDao;
import com.springmvchomework.dao.StudentDaoImpl;
import com.springmvchomework.pojo.Student;

import java.util.List;

/**
 * @author 从卿
 * @create 2022/4/12-22:01
 */
public class StudentServiceImpl implements StudentService {
    StudentDao studentDao=new StudentDaoImpl();
    @Override
    public int addStudent(Student student) {
        return this.studentDao.insertStudent(student);
    }

    @Override
    public int updateStu(Student student){
        return this.studentDao.updateStudent(student);
    }

    @Override
    public Student preUpdateStu(String name) {
        return this.studentDao.findStuByName(name);
    }

    @Override
    public List<Student> showStu() {
        return this.studentDao.selectStu();
    }
}
